<% rfcs = @rfcs ? @rfcs.values.flatten : []
   change_count = rfcs.size
   change_count += 1 if @platform.rfcAction.present? %>
<% if change_count > 0 %>
  <div class="marker"><%= status_marker('release', "#{change_count} #{'change'.pluralize(change_count)}", action_to_label(@platform.rfcAction.presence || 'update')) %></div>
  <div class="description">
    <dl class="dl-horizontal">
      <dt><%= icon('star', ' ', 'fa-fw') %></dt>
      <dd>
        There <%= change_count > 1 ? 'are' : 'is' %> <strong><%= "#{change_count} #{'change'.pluralize(change_count)}" %></strong>
        pending for this platform in the open release <%= link_to(@release.releaseId, path_to_release(@release)) %>
        created <strong><%= time_ago_in_words(@release.created_timestamp) %></strong>
      </dd>
      <% latest_rfc = rfcs.inject(rfcs.first) {|l, r| r.rfcUpdated > l.rfcUpdated ? r : l} %>
      <% if latest_rfc %>
        <% latest_user = latest_rfc.rfcUpdatedBy || latest_rfc.rfcCreatedBy %>
        <dt><%= icon('clock-o', ' ', 'fa-fw') %></dt>
        <dd>
          Last change in this platform was <strong><%= time_ago_in_words(latest_rfc.rfc_updated_timestamp) %></strong>
          <%= raw(" by <strong>#{latest_user}</strong>") if latest_user %>
        </dd>
      <% end %>
      <dt>&nbsp;</dt>
      <dd>
        <ul class="inline">
          <li>
            <%= link_to('Review',
                        assembly_design_platform_path(@assembly, @platform, :anchor => 'release'),
                        :class => 'btn btn-primary') %>
          </li>
          <%= render 'release_controls' if has_design?(@assembly.ciId)%>
        </ul>
      </dd>
    </dl>
  </div>
<% else %>
  <div class="marker"><%= status_marker('release', 'no changes') %></div>
  <div class="description">
    <dl class="dl-horizontal">
      <dt><%= icon('star', ' ', 'fa-fw') %></dt>
      <% if @release.releaseState == 'open' %>
        <dd>
          <strong>No changes</strong> for this platform in the open release <%= link_to(@release.releaseId, path_to_release(@release)) %>
          created <strong><%= time_ago_in_words(@release.created_timestamp) %></strong>
        </dd>
      <% else %>
        <dd>
          There are <strong>no changes</strong> for this platform
        </dd>
      <% end %>
      <dt><%= icon('th-list', ' ', 'fa-fw') %></dt>
      <dd>
        <%= link_to(highlight('View', 'info'), assembly_design_path(@assembly, :anchor => 'timeline')) %> history of design releases
      </dd>
    </dl>
  </div>
<% end %>
